package de.fstyle.android.worldcanvas;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.view.Window;

public class MainActivity extends FragmentActivity {

	// global constants

	public static final String LOG_TAG = "main_activity";

	/**
	 * The {@link android.support.v4.view.PagerAdapter} that will provide
	 * fragments for each of the three primary sections of the app. We use a
	 * {@link android.support.v4.app.FragmentPagerAdapter} derivative, which
	 * will keep every loaded fragment in memory. If this becomes too memory
	 * intensive, it may be best to switch to a
	 * {@link android.support.v4.app.FragmentStatePagerAdapter}.
	 */
	private MainPagerAdapter mainPagerAdapter;

	/**
	 * The {@link ViewPager} that will display the three primary sections of the
	 * app, one at a time.
	 */
	private ViewPager mainViewPager;

	public void onCreate(Bundle savedInstanceState) {

		// setup activity

		super.onCreate(savedInstanceState);

		// may hide title and action bar
		requestWindowFeature(Window.FEATURE_NO_TITLE);
//		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.activity_main);

		// setup fragments

		// Create the adapter that will return a fragment for each of the three
		// primary sections of the app.
		this.mainPagerAdapter = new MainPagerAdapter(
				getSupportFragmentManager());

		// Set up the ViewPager, attaching the adapter and setting up a listener
		// for when the user swipes between sections.
		this.mainViewPager = (ViewPager) findViewById(R.id.pager);
		this.mainViewPager.setAdapter(this.mainPagerAdapter);

	}


}
